﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BWebColumn.aspx.cs" Inherits="SysManage_RolesM_BWebColumn" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>系统页面字段管理</title>
    <link href="../../CSS/SubStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Jscript/wyyjs.js"></script>
    <script type="text/javascript" language="javascript">
        function boundvalid() {
            boundsource("ddlTableName", "[^-1]", "不能为空--Not null", "cmdAdd,cmdEdit");
            boundsource("TxtColumnName", "^.+$", "名称不能为空--Not null", "cmdAdd,cmdEdit");
            boundsource("TxtColumnType", "^.+$", "类型不能为空--Not null", "cmdAdd,cmdEdit");
            boundsource("txtColumnWidth", "^.+$", "字段长不能为空--Not null", "cmdAdd,cmdEdit");
            boundsource("txtColumnPosition", "^.+$", "字段长不能为空--Not null", "cmdAdd,cmdEdit");
        }
        //文本框输入只能为非负数
        function txtIsNumber(txtID) {
            var a = document.getElementById(txtID).value;
            if (!(Math.abs(a) == a) || a == "") {
                alert("只能是非负数,也不能为空-Not less than zero！");
                document.getElementById(txtID).value = "0";
                document.getElementById(txtID).focus();
                return false;
            }
            else
            { return true; }
        }
    </script>
</head>
<body onload="boundvalid();">
    <form id="form1" runat="server">
        <table cellpadding="0" cellspacing="0" class="topTable">
            <tr>
                <td class="topTd">
                    <asp:Label ID="lblLocation" runat="server" Text="<%$ Resources:language, Location %>"></asp:Label>
                    <img alt="当前位置" src="../../Image/weizhi.gif" />>>
                    <asp:Label ID="Label1" runat="server" Text="页面字段管理"></asp:Label>
                    <asp:Label ID="Label2" runat="server" Text="<%$ Resources:language, Must1 %>"></asp:Label>
                    <font color="#ff0000">*</font>
                    <asp:Label ID="Label3" runat="server" Text="<%$ Resources:language, Must2 %>"></asp:Label>
                </td>
            </tr>
        </table>
        <fieldset>
           <legend><font style="font-size: 12px;">
                 <asp:Label ID="lblLegend1" runat="server" Text="<%$ Resources:language, Legend1 %>"></asp:Label></font></legend>
                        <table cellpadding="0" cellspacing="0" class="topHeadTable">                                        
                                        <tr>
                                            <td style="height:10px;" colspan="6">
                                                </td>
                                        </tr>
                                        <tr>
                                            <td class="td10">
                                                <span style="color: #ff0000">*</span>
                                                <asp:Label ID="Label5" runat="server" Text="<%$ Resources:hwlan, swcType %>"></asp:Label>
                                                :</td>
                                            <td class="td20">
                                                <asp:TextBox ID="TxtColumnType" CssClass="txtStyle" runat="server" 
                                                    MaxLength="50"></asp:TextBox>
                                            </td>
                                            <td class="td10">
                                                <span style="color: #ff0000">*</span>
                                                <asp:Label ID="Label6" runat="server" Text="<%$ Resources:hwlan, swcName %>"></asp:Label>
                                                :</td>
                                            <td class="td20">
                                                <asp:TextBox ID="TxtColumnName" runat="server" CssClass="txtStyle" MaxLength="50"></asp:TextBox></td>
                                              <td class="td10">
                                                <asp:Label ID="Label11" runat="server" Text="时间格式"></asp:Label>
                                                  :</td> 
                                                <td class="td20">
                                                <asp:DropDownList ID="ddlTimeStyle" runat="server" Width="100%">
                                                    <asp:ListItem Value="0">请选择(Select Please)</asp:ListItem>
                                                    <asp:ListItem>yyyy-mm-dd</asp:ListItem>
                                                    <asp:ListItem>yyyymmdd</asp:ListItem>
                                                    <asp:ListItem>yy-mm-dd</asp:ListItem>
                                                    <asp:ListItem>yymmdd</asp:ListItem>
                                                    <asp:ListItem>yyyy-mm</asp:ListItem>
                                                    <asp:ListItem>yyyymm</asp:ListItem>
                                                    <asp:ListItem>mm-dd</asp:ListItem>
                                                    <asp:ListItem Value="mmdd"></asp:ListItem>
                                                    <asp:ListItem>mm/dd/yyyy</asp:ListItem>
                                                    <asp:ListItem>mm/dd/yy</asp:ListItem>
                                                    <asp:ListItem>mm/dd/</asp:ListItem>
                                                    <asp:ListItem Value="mm/yyyy"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="td10">
                                                <asp:Label ID="Label7" runat="server" Text="显示顺序位置"></asp:Label>:</td>
                                            <td class="td20">
                                                <asp:TextBox ID="txtColumnPosition" runat="server" onblur="txtIsNumber(this.id)" CssClass="txtStyle" MaxLength="20"></asp:TextBox></td>
                                            <td class="td10">
                                                <span style="color: #ff0000">*</span><asp:Label ID="Label4" runat="server" Text="字段显示长度"></asp:Label>
                                                :</td>
                                            <td class="td20">
                                                <asp:TextBox ID="txtColumnWidth" runat="server" onblur="txtIsNumber(this.id)" CssClass="txtStyle" MaxLength="10" Text="140"></asp:TextBox></td>
                                            <td class="td10">
                                                <asp:Label ID="Label9" runat="server" Text="表名"></asp:Label>
                                                :</td>
                                            <td  class="td20">
                                                <asp:DropDownList ID="ddlTableName" runat="server" Width="100%">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="td10">
                                               <asp:Label ID="Label12" runat="server" Text="From other DB"></asp:Label>:</td>
                                            <td class="td20">                                                
                                                <asp:RadioButtonList ID="radDataFromScala" runat="server" 
                                                    RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                                    <asp:ListItem Value="1">是</asp:ListItem>
                                                </asp:RadioButtonList>
                                                </td>
                                            <td class="td10">
                                                <asp:Label ID="Label10" runat="server" Text="RepeatFlag"></asp:Label>
                                                :</td>
                                            <td class="td20">
                                                <asp:DropDownList ID="ddlReaptFlag" runat="server" Width="100%">
                                                    <asp:ListItem Selected="True" Value="0">Not Repeat</asp:ListItem>
                                                    <asp:ListItem Value="1">Repeat</asp:ListItem>
                                                </asp:DropDownList>
                                                </td>
                                            <td class="td10" >
                                                <asp:Label ID="Label13" runat="server" Text="下拉选择:"></asp:Label>
                                                </td>
                                            <td class="td20" >
                                                <asp:RadioButtonList ID="radDropDownListName" runat="server" 
                                                    RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                                    <asp:ListItem Value="1">是</asp:ListItem>
                                                </asp:RadioButtonList>
                                                </td>
                                        </tr>
                                        <tr>
                                            <td class="td10">
                                                <asp:Label ID="Label8" runat="server" Text="<%$ Resources:hwlan, desc %>"></asp:Label>
                                                :</td>
                                            <td class="td20" colspan="3">                                                
                                                <asp:TextBox ID="TxtColumnDesc" CssClass="txtStyle" runat="server" 
                                                    MaxLength="500" Columns="100" Height="40px" TextMode="MultiLine"></asp:TextBox></td>
                                            <td class="td10" >
                                                &nbsp;</td>
                                            <td class="td20" >
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td style="height:10px;" colspan="6">
                                                </td>
                                        </tr>
                                        </table>
                        <div class="cmdButtonsDiv">
                                    &nbsp;<asp:Button ID="cmdQuery" runat="server" CssClass="cmdStyle" OnClick="cmdQuery_Click"
                                        Text="<%$ Resources:hwlan, search %>" />
                                    &nbsp;<asp:Button ID="cmdAdd" runat="server" Text="<%$ Resources:hwlan, insert %>"
                                        CssClass="cmdStyle" OnClick="cmdAdd_Click" />
                                    &nbsp;<asp:Button ID="cmdEdit" runat="server" Text="<%$ Resources:hwlan, edit %>"
                                        CssClass="cmdStyle" Enabled="False" OnClick="cmdEdit_Click" />
                                    <input id="cmdClear" class="cmdStyle" type="button" runat="server" value="<%$ Resources:hwlan, reset %>"
                                        onserverclick="cmdClear_ServerClick" />                               
                        </div>
                    </fieldset>
       <fieldset>
                        <legend><font style="font-size: 12px;">
                            <asp:Label ID="lblLegend2" runat="server" Text="<%$ Resources:language, Legend2 %>"></asp:Label></font></legend>
                        <div class="grvDiv">
                            <asp:GridView ID="GrvColumns" runat="server" AutoGenerateColumns="False" 
                                CssClass="gvStyle" Width="100%"
                                AllowPaging="True" GridLines="None" PageSize="15" OnRowDeleting="GrvColumns_RowDeleting"
                                OnRowDataBound="GrvColumns_RowDataBound" 
                                OnPageIndexChanging="GrvColumns_PageIndexChanging" 
                                OnRowCommand="GrvColumns_RowCommand" 
                                onselectedindexchanged="GrvColumns_SelectedIndexChanged" 
                                DataKeyNames="ReaptFlagValue,DataFromScalaFlag,ColumnDesc,DropDownListNameFlag">
                                <HeaderStyle CssClass="gvHeader" />
                                <RowStyle CssClass="gvRow" />
                                <AlternatingRowStyle CssClass="gvAllRow" />
                                <Columns>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            NO.</HeaderTemplate>
                                        <ItemTemplate>
                                            <%#GrvColumns.PageIndex * GrvColumns.PageSize + GrvColumns.Rows.Count + 1%>
                                        </ItemTemplate>
                                        <ItemStyle CssClass="gvItem" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="ColumnType" HeaderText="<%$ Resources:hwlan, swcType %>">
                                        <ItemStyle CssClass="gvItem" HorizontalAlign="left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ColumnName" HeaderText="<%$ Resources:hwlan, swcName %>">
                                        <ItemStyle CssClass="gvItem" HorizontalAlign="left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ColumnWidth" HeaderText="PX">
                                        <ItemStyle CssClass="gvItem" HorizontalAlign="left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ColumnPosition" HeaderText="PositionOrder">
                                        <ItemStyle CssClass="gvItem" HorizontalAlign="left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ColumnDesc" HeaderText="<%$ Resources:hwlan, desc %>" Visible="false">
                                        <ItemStyle CssClass="gvItem" HorizontalAlign="left" Wrap="false" Width="120px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="BelongToTableName" HeaderText="数据表名">
                                        <ItemStyle CssClass="gvItem" HorizontalAlign="left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="RepeatFlag" HeaderText="RepeatFlag">                                        
                                        <ItemStyle CssClass="gvItem" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ColumnTimeStyle" HeaderText="Time Style">                                        
                                        <ItemStyle CssClass="gvItem" />
                                     </asp:BoundField>
                                    <asp:BoundField DataField="DataFromScalaFlagShow" HeaderText="From other DB">                                        
                                        <ItemStyle CssClass="gvItem" />
                                     </asp:BoundField>
                                    <asp:BoundField DataField="DropDownListNameFlagShow" HeaderText="下拉选择">                                        
                                        <ItemStyle CssClass="gvItem" />
                                     </asp:BoundField>
                            <asp:CommandField HeaderText="<%$ Resources:language, Edit %>" ShowSelectButton="true"
                                SelectText="&lt;img border=0 alt=&quot;Edit&quot; src=../../Image/edit.gif&gt;">
                                <ItemStyle CssClass="gvItem" />
                            </asp:CommandField><%--
                                    <asp:CommandField ShowEditButton="True" EditText="&lt;img border=0 alt=&quot;Edit&quot; src=../../Image/edit.gif&gt;"
                                        HeaderText="<%$ Resources:language, Edit %>">
                                        <ItemStyle CssClass="gvItem" />
                                    </asp:CommandField>--%>
                                    <asp:CommandField ShowDeleteButton="True" DeleteText="&lt;img border=0 alt=&quot;Delete&quot; src=../../Image/del.gif&gt;"
                                        HeaderText="<%$ Resources:language, Delete %>">
                                        <ItemStyle CssClass="gvItem" />
                                    </asp:CommandField>
                                </Columns>
                                <PagerTemplate>
                                    <table style="width: 100%;">
                                        <tr>
                                            <td align="left">
                                                <asp:Label ID="lblTotal1" runat="server" Text="<%$ Resources:UserSqlPage, Total1 %>"></asp:Label><asp:Label
                                                    ID="lblCount" runat="server"></asp:Label><asp:Label ID="Total2" runat="server" Text="<%$ Resources:UserSqlPage, Total2 %>"></asp:Label>,<asp:Label
                                                        ID="Label5" runat="server" Text="<%$ Resources:UserSqlPage, CurrentPage1 %>"></asp:Label><asp:Label
                                                            ID="lblPageIndex" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>' /><asp:Label
                                                                ID="Label11" runat="server" Text="<%$ Resources:UserSqlPage, CurrentPage2 %>"></asp:Label>,<asp:Label
                                                                    ID="Label3" runat="server" Text="<%$ Resources:UserSqlPage, TotalPage1 %>"></asp:Label><asp:Label
                                                                        ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount  %>' /><asp:Label
                                                                            ID="Label12" runat="server" Text="<%$ Resources:UserSqlPage, TotalPage2 %>"></asp:Label>
                                                <% //首页/上一页 %>
                                                <% if (this.GrvColumns.PageIndex <= 0)
                                                   { %>
                                                <asp:LinkButton ID="LinkButton1" runat="server" Enabled="false" Text="<%$ Resources:UserSqlPage, FirstPage %>" />&nbsp;
                                                <asp:LinkButton ID="LinkButton2" runat="server" Enabled="false" Text="<%$ Resources:UserSqlPage, PreviousPage %>" />&nbsp;
                                                <% }
                                                   else
                                                   { %>
                                                <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandArgument="First"
                                                    CommandName="Page" Text="<%$ Resources:UserSqlPage, FirstPage %>" />&nbsp;
                                                <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandArgument="Prev"
                                                    CommandName="Page" Text="<%$ Resources:UserSqlPage, PreviousPage %>" />&nbsp;
                                                <% } %>
                                                <% //下一页/尾页 %>
                                                <% if (this.GrvColumns.PageIndex >= GrvColumns.PageCount - 1)
                                                   { %>
                                                <asp:LinkButton ID="LinkButton5" runat="server" Enabled="false" Text="<%$ Resources:UserSqlPage, NextPage %>" />&nbsp;
                                                <asp:LinkButton ID="LinkButton6" runat="server" Enabled="false" Text="<%$ Resources:UserSqlPage, LastPage %>" />
                                                <% }
                                                   else
                                                   { %>
                                                <asp:LinkButton ID="LinkButton7" runat="server" CausesValidation="False" CommandArgument="Next"
                                                    CommandName="Page" Text="<%$ Resources:UserSqlPage, NextPage %>" />&nbsp;
                                                <asp:LinkButton ID="LinkButton8" runat="server" CausesValidation="False" CommandArgument="Last"
                                                    CommandName="Page" Text="<%$ Resources:UserSqlPage, LastPage %>" />
                                                <% } %>
                                                <asp:TextBox ID="txtNewPageIndex" runat="server" Text="<%# ((GridView)Container.Parent.Parent).PageIndex + 1%>"
                                                    Width="20px"></asp:TextBox>
                                                <asp:LinkButton ID="btnGo" runat="server" CausesValidation="False" CommandArgument="-1"
                                                    CommandName="NewPage" Text="<%$ Resources:UserSqlPage, PageGo %>"></asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </PagerTemplate>
                            </asp:GridView>
                            <div style="height: 5px">
                            </div>
                        </div>
                    </fieldset>
                    <asp:HiddenField ID="HidQueryFlag" runat="server" Value="0" />                   
    </form>
</body>
</html>